package com.example.freshmenclient.util;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.example.freshmenclient.R;

public class FragmentUtil {

    /**
     * 动态注册Fragment
     * @param fragmentManager
     * @param fragment
     */
    public static void registerFragment(FragmentManager fragmentManager, Fragment fragment) {

        FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.replace(R.id.fl_container, fragment);
        transaction.commit();
    }
}
